package com.smartinput.voice.domain.repository

import com.smartinput.voice.domain.model.VoiceRecord
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.Query
import org.springframework.data.repository.query.Param
import org.springframework.stereotype.Repository

@Repository
interface VoiceRecordRepository : JpaRepository<VoiceRecord, String> {
    @Query("SELECT v FROM VoiceRecord v WHERE v.userId = :userId ORDER BY v.createdAt DESC LIMIT :limit")
    fun findByUserIdOrderByCreatedAtDesc(@Param("userId") userId: String, @Param("limit") limit: Int): List<VoiceRecord>
} 